package UnOfficeDeTourisme;

/**
 * Interface definition : SGCartes
 * 
 * @author OpenORB Compiler
 */
public class _SGCartesStub extends org.omg.CORBA.portable.ObjectImpl
        implements SGCartes
{
    static final String[] _ids_list =
    {
        "IDL:UnOfficeDeTourisme/SGCartes:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = UnOfficeDeTourisme.SGCartesOperations.class;

    /**
     * Operation ajouterTouriste
     */
    public int ajouterTouriste(String nom, String prenom, String mail)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("ajouterTouriste",true);
                    _output.write_string(nom);
                    _output.write_string(prenom);
                    _output.write_string(mail);
                    _input = this._invoke(_output);
                    int _arg_ret = _input.read_long();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("ajouterTouriste",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCartesOperations _self = (UnOfficeDeTourisme.SGCartesOperations) _so.servant;
                try
                {
                    return _self.ajouterTouriste( nom,  prenom,  mail);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation creerCarte
     */
    public int creerCarte(int idPrestation, int idTouriste)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("creerCarte",true);
                    _output.write_long(idPrestation);
                    _output.write_long(idTouriste);
                    _input = this._invoke(_output);
                    int _arg_ret = _input.read_long();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("creerCarte",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCartesOperations _self = (UnOfficeDeTourisme.SGCartesOperations) _so.servant;
                try
                {
                    return _self.creerCarte( idPrestation,  idTouriste);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation ajouterEntree
     */
    public void ajouterEntree(UnOfficeDeTourisme.Entree e, int idCarte)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("ajouterEntree",true);
                    UnOfficeDeTourisme.EntreeHelper.write(_output,e);
                    _output.write_long(idCarte);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("ajouterEntree",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCartesOperations _self = (UnOfficeDeTourisme.SGCartesOperations) _so.servant;
                try
                {
                    _self.ajouterEntree( e,  idCarte);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation listerCartes
     */
    public UnOfficeDeTourisme.Carte[] listerCartes()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("listerCartes",true);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Carte[] _arg_ret = UnOfficeDeTourisme.listeCartesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("listerCartes",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCartesOperations _self = (UnOfficeDeTourisme.SGCartesOperations) _so.servant;
                try
                {
                    return _self.listerCartes();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation listerCartesTouriste
     */
    public UnOfficeDeTourisme.Carte[] listerCartesTouriste(int idTouriste)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("listerCartesTouriste",true);
                    _output.write_long(idTouriste);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Carte[] _arg_ret = UnOfficeDeTourisme.listeCartesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("listerCartesTouriste",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCartesOperations _self = (UnOfficeDeTourisme.SGCartesOperations) _so.servant;
                try
                {
                    return _self.listerCartesTouriste( idTouriste);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getEntreesVisite
     */
    public UnOfficeDeTourisme.Entree[] getEntreesVisite(int idVisite, int idCarte)
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getEntreesVisite",true);
                    _output.write_long(idVisite);
                    _output.write_long(idCarte);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Entree[] _arg_ret = UnOfficeDeTourisme.listeEntreesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getEntreesVisite",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCartesOperations _self = (UnOfficeDeTourisme.SGCartesOperations) _so.servant;
                try
                {
                    return _self.getEntreesVisite( idVisite,  idCarte);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getEntreesCarte
     */
    public UnOfficeDeTourisme.Entree[] getEntreesCarte(int idCarte)
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getEntreesCarte",true);
                    _output.write_long(idCarte);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Entree[] _arg_ret = UnOfficeDeTourisme.listeEntreesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getEntreesCarte",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCartesOperations _self = (UnOfficeDeTourisme.SGCartesOperations) _so.servant;
                try
                {
                    return _self.getEntreesCarte( idCarte);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation desactiverCarte
     */
    public void desactiverCarte(int idCarte)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("desactiverCarte",true);
                    _output.write_long(idCarte);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("desactiverCarte",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCartesOperations _self = (UnOfficeDeTourisme.SGCartesOperations) _so.servant;
                try
                {
                    _self.desactiverCarte( idCarte);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation passerPortique
     */
    public UnOfficeDeTourisme.Entree[] passerPortique(int idVisite, int idTouriste)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("passerPortique",true);
                    _output.write_long(idVisite);
                    _output.write_long(idTouriste);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Entree[] _arg_ret = UnOfficeDeTourisme.listeEntreesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("passerPortique",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCartesOperations _self = (UnOfficeDeTourisme.SGCartesOperations) _so.servant;
                try
                {
                    return _self.passerPortique( idVisite,  idTouriste);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation donnerAvis
     */
    public UnOfficeDeTourisme.Entree[] donnerAvis(int idVisite, int idTouriste, String avis)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("donnerAvis",true);
                    _output.write_long(idVisite);
                    _output.write_long(idTouriste);
                    _output.write_string(avis);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Entree[] _arg_ret = UnOfficeDeTourisme.listeEntreesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("donnerAvis",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCartesOperations _self = (UnOfficeDeTourisme.SGCartesOperations) _so.servant;
                try
                {
                    return _self.donnerAvis( idVisite,  idTouriste,  avis);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
